using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace DataWinner.Entity.Nba_Sina.Models.Mapping
{
    public class OnlineUser_SinaMap : EntityTypeConfiguration<OnlineUser_Sina>
    {
        public OnlineUser_SinaMap()
        {
            // Primary Key
            this.HasKey(t => t.OnlineUserId);

            // Properties
            this.Property(t => t.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(t => t.OnlineUserId)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Username)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.Password)
                .IsRequired()
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("OnlineUser_Sina");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.OnlineUserId).HasColumnName("OnlineUserId");
            this.Property(t => t.Username).HasColumnName("Username");
            this.Property(t => t.Password).HasColumnName("Password");
            this.Property(t => t.CreateBy).HasColumnName("CreateBy");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");
            this.Property(t => t.ModifyBy).HasColumnName("ModifyBy");
            this.Property(t => t.ModifyTime).HasColumnName("ModifyTime");
            this.Property(t => t.IsDeleted).HasColumnName("IsDeleted");
        }
    }
}
